﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Ndo
{
    public delegate T Generator<T>();
    public sealed class Generating<T>
    {
        public Generator<T> Gtor;
        public Generating(Generator<T> g)
        {
            Gtor = g;
        }
        public T[] Array(int n)
        {
            T[] ret = new T[n];
            for (int i = 0; i < n; i++)
                ret[i] = Gtor();
            return ret;
        }
        public T[][] ArrayArray(int n1, int n2)
        {
            T[][] ret = new T[n1][];
            for (int i = 0; i < n1; i++)
                ret[i] = Array(n2);
            return ret;
        }
    }
}
